<layout name="Layout/base" />
<div class="container">
    <div>
        <a href="{:U('Home/Message/show', array('sort'=>'publish_time', 'p'=>$_GET['p']))}">发布时间</a>
        <a href="{:U('Home/Message/show', array('sort'=>'name', 'p'=>$_GET['p']))}">姓名</a>
    </div>
    <table class="table">
        <thead>
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>邮箱</th>
                <th>电话</th>
                <th>内容</th>
                <th>时间</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach($messages as $key=>$message): ?>
                <tr>
                    <td>{$message['id']}</td>
                    <td>{$message['name']}</td>
                    <td>{$message['email']}</td>
                    <td>{$message['tel']}</td>
                    <td>{$message['content']}</td>
                    <td>{:parse_show_datetime($message['publish_time'])}</td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    <?php echo $page; ?>
</div>
